import { Select } from "antd"
import React from "react"

import { SFormItem } from "@/components/common"
import { useOptions } from "@/hooks"
import { useLocale } from "@/locales"
interface OperationTypeSelectProps {
	name?: string
	label?: string
}
export default function OperationTypeSelect({ name, label }: OperationTypeSelectProps) {
	const { formatMessage, newFormat } = useLocale()
	const options = useOptions({ modal: "operateTypeArr", func: formatMessage, strictlyLabel: false })

	return (
		<SFormItem name={name ?? "operateType"} label={label ? newFormat(label) : newFormat("common.operation_type")}>
			<Select placeholder={newFormat("common.select_all")} style={{ width: 200 }} options={options} />
		</SFormItem>
	)
}
